package com.ruoyi.system.service.impl;

import java.math.BigDecimal;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.AlpStageActualMapper;
import com.ruoyi.system.domain.AlpStageActual;
import com.ruoyi.system.service.IAlpStageActualService;
import com.ruoyi.common.core.text.Convert;

/**
 * 实际收款Service业务层处理
 * 
 * @author zhangjun
 * @date 2020-02-15
 */
@Service
public class AlpStageActualServiceImpl implements IAlpStageActualService 
{
    @Autowired
    private AlpStageActualMapper alpStageActualMapper;

    /**
     * 查询实际收款
     * 
     * @param id 实际收款ID
     * @return 实际收款
     */
    @Override
    public AlpStageActual selectAlpStageActualById(Long id)
    {
        return alpStageActualMapper.selectAlpStageActualById(id);
    }

    /**
     * 查询实际收款
     *
     * @param stageId 阶段ID
     * @return 实际收款
     */
    @Override
    public List<AlpStageActual> selectAlpStageActualByStageId(Long stageId)
    {
        return alpStageActualMapper.selectAlpStageActualByStageId(stageId);
    }

    /**
     * 查询实际收款列表
     * 
     * @param alpStageActual 实际收款
     * @return 实际收款
     */
    @Override
    public List<AlpStageActual> selectAlpStageActualList(AlpStageActual alpStageActual)
    {
        return alpStageActualMapper.selectAlpStageActualList(alpStageActual);
    }

    /**
     * 新增实际收款
     * 
     * @param alpStageActual 实际收款
     * @return 结果
     */
    @Override
    public int insertAlpStageActual(AlpStageActual alpStageActual)
    {
        return alpStageActualMapper.insertAlpStageActual(alpStageActual);
    }

    /**
     * 修改实际收款
     * 
     * @param alpStageActual 实际收款
     * @return 结果
     */
    @Override
    public int updateAlpStageActual(AlpStageActual alpStageActual)
    {
        return alpStageActualMapper.updateAlpStageActual(alpStageActual);
    }

    /**
     * 删除实际收款对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteAlpStageActualByIds(String ids)
    {
        return alpStageActualMapper.deleteAlpStageActualByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除实际收款信息
     * 
     * @param id 实际收款ID
     * @return 结果
     */
    @Override
    public int deleteAlpStageActualById(Long id)
    {
        return alpStageActualMapper.deleteAlpStageActualById(id);
    }

    @Override
    public BigDecimal calcSumByContractId(Long contractId) {
        return alpStageActualMapper.calcSumByContractId(contractId);
    }
}
